<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - ged.info - gil/metafunctions.hpp</title>
  <link rel="stylesheet" type="text/css" href="../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../index.html">directory</a> - <a href="index.html">gil</a> - metafunctions.hpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>ged.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-06-09</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">1</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">0.0 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">0</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : /*
<span class="lineNum">       2 </span>                :     Copyright 2005-2007 Adobe Systems Incorporated
<span class="lineNum">       3 </span>                :    
<span class="lineNum">       4 </span>                :     Use, modification and distribution are subject to the Boost Software License,
<span class="lineNum">       5 </span>                :     Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
<span class="lineNum">       6 </span>                :     http://www.boost.org/LICENSE_1_0.txt).
<span class="lineNum">       7 </span>                : 
<span class="lineNum">       8 </span>                :     See http://opensource.adobe.com/gil for most recent version including documentation.
<span class="lineNum">       9 </span>                : */
<span class="lineNum">      10 </span>                : 
<span class="lineNum">      11 </span>                : /*************************************************************************************************/
<span class="lineNum">      12 </span>                : 
<span class="lineNum">      13 </span>                : #ifndef GIL_METAFUNCTIONS_HPP
<span class="lineNum">      14 </span>                : #define GIL_METAFUNCTIONS_HPP
<span class="lineNum">      15 </span>                : 
<span class="lineNum">      16 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      17 </span>                : /// \file               
<span class="lineNum">      18 </span>                : /// \brief metafunctions that construct types or return type properties
<span class="lineNum">      19 </span>                : /// \author Lubomir Bourdev and Hailin Jin \n
<span class="lineNum">      20 </span>                : ///         Adobe Systems Incorporated
<span class="lineNum">      21 </span>                : ///
<span class="lineNum">      22 </span>                : /// \date 2005-2007 \n Last updated on February 6, 2007
<span class="lineNum">      23 </span>                : ///
<span class="lineNum">      24 </span>                : ////////////////////////////////////////////////////////////////////////////////////////
<span class="lineNum">      25 </span>                : 
<span class="lineNum">      26 </span>                : #include &lt;iterator&gt;
<span class="lineNum">      27 </span>                : #include &lt;boost/mpl/accumulate.hpp&gt;
<span class="lineNum">      28 </span>                : #include &lt;boost/mpl/back.hpp&gt;
<span class="lineNum">      29 </span>                : #include &lt;boost/mpl/bool.hpp&gt;
<span class="lineNum">      30 </span>                : #include &lt;boost/mpl/if.hpp&gt;
<span class="lineNum">      31 </span>                : #include &lt;boost/mpl/pop_back.hpp&gt;
<span class="lineNum">      32 </span>                : #include &lt;boost/mpl/push_back.hpp&gt;
<span class="lineNum">      33 </span>                : #include &lt;boost/mpl/transform.hpp&gt;
<span class="lineNum">      34 </span>                : #include &lt;boost/mpl/vector.hpp&gt;
<span class="lineNum">      35 </span>                : #include &lt;boost/type_traits.hpp&gt;
<span class="lineNum">      36 </span>                : #include &quot;gil_config.hpp&quot;
<span class="lineNum">      37 </span>                : #include &quot;gil_concept.hpp&quot;
<span class="lineNum">      38 </span>                : #include &quot;channel.hpp&quot;
<span class="lineNum">      39 </span>                : 
<span class="lineNum">      40 </span>                : namespace boost { namespace gil {
<span class="lineNum">      41 </span>                : 
<span class="lineNum">      42 </span>                : // forward declarations
<span class="lineNum">      43 </span>                : template &lt;typename T, typename L&gt; struct pixel;
<span class="lineNum">      44 </span>                : template &lt;typename BitField,typename ChannelRefVec,typename Layout&gt; struct packed_pixel;
<span class="lineNum">      45 </span>                : template &lt;typename T, typename C&gt; struct planar_pixel_reference;
<span class="lineNum">      46 </span>                : template &lt;typename IC, typename C&gt; struct planar_pixel_iterator;
<span class="lineNum">      47 </span>                : template &lt;typename I&gt; class memory_based_step_iterator;
<span class="lineNum">      48 </span>                : template &lt;typename I&gt; class memory_based_2d_locator;
<span class="lineNum">      49 </span><span class="lineNoCov">              0 : template &lt;typename L&gt; class image_view;</span>
<span class="lineNum">      50 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt; class image;
<span class="lineNum">      51 </span>                : template &lt;typename T&gt; struct channel_type;
<span class="lineNum">      52 </span>                : template &lt;typename T&gt; struct color_space_type;
<span class="lineNum">      53 </span>                : template &lt;typename T&gt; struct channel_mapping_type;
<span class="lineNum">      54 </span>                : template &lt;typename It&gt; struct is_iterator_adaptor;
<span class="lineNum">      55 </span>                : template &lt;typename It&gt; struct iterator_adaptor_get_base;
<span class="lineNum">      56 </span>                : template &lt;typename BitField, typename ChannelBitSizes, typename Layout, bool IsMutable&gt; struct bit_aligned_pixel_reference;
<span class="lineNum">      57 </span>                : 
<span class="lineNum">      58 </span>                : //////////////////////////////////////////////////
<span class="lineNum">      59 </span>                : ///
<span class="lineNum">      60 </span>                : ///  TYPE ANALYSIS METAFUNCTIONS
<span class="lineNum">      61 </span>                : ///  Predicate metafunctions determining properties of GIL types
<span class="lineNum">      62 </span>                : ///
<span class="lineNum">      63 </span>                : //////////////////////////////////////////////////
<span class="lineNum">      64 </span>                : 
<span class="lineNum">      65 </span>                : 
<span class="lineNum">      66 </span>                : /// \defgroup GILIsBasic xxx_is_basic
<span class="lineNum">      67 </span>                : /// \ingroup TypeAnalysis
<span class="lineNum">      68 </span>                : /// \brief Determines if GIL constructs are basic. 
<span class="lineNum">      69 </span>                : ///    Basic constructs are the ones that can be generated with the type 
<span class="lineNum">      70 </span>                : ///    factory methods pixel_reference_type, iterator_type, locator_type, view_type and image_type
<span class="lineNum">      71 </span>                : ///    They can be mutable/immutable, planar/interleaved, step/nonstep. They must use GIL-provided models.
<span class="lineNum">      72 </span>                : 
<span class="lineNum">      73 </span>                : /// \brief Determines if a given pixel reference is basic
<span class="lineNum">      74 </span>                : ///    Basic references must use gil::pixel&amp; (if interleaved), gil::planar_pixel_reference (if planar). They must use the standard constness rules. 
<span class="lineNum">      75 </span>                : /// \ingroup GILIsBasic
<span class="lineNum">      76 </span>                : template &lt;typename PixelRef&gt;        struct pixel_reference_is_basic                     : public mpl::false_ {};
<span class="lineNum">      77 </span>                : template &lt;typename T,  typename L&gt;  struct pixel_reference_is_basic&lt;      pixel&lt;T,L&gt;&amp;&gt;  : public mpl::true_ {};
<span class="lineNum">      78 </span>                : template &lt;typename T,  typename L&gt;  struct pixel_reference_is_basic&lt;const pixel&lt;T,L&gt;&amp;&gt;  : public mpl::true_ {};
<span class="lineNum">      79 </span>                : template &lt;typename TR, typename Cs&gt; struct pixel_reference_is_basic&lt;planar_pixel_reference&lt;TR,Cs&gt; &gt; : public mpl::true_ {};
<span class="lineNum">      80 </span>                : template &lt;typename TR, typename Cs&gt; struct pixel_reference_is_basic&lt;const planar_pixel_reference&lt;TR,Cs&gt; &gt; : public mpl::true_ {};
<span class="lineNum">      81 </span>                : 
<span class="lineNum">      82 </span>                : 
<span class="lineNum">      83 </span>                : /// \brief Determines if a given pixel iterator is basic
<span class="lineNum">      84 </span>                : ///    Basic iterators must use gil::pixel (if interleaved), gil::planar_pixel_iterator (if planar) and gil::memory_based_step_iterator (if step). They must use the standard constness rules. 
<span class="lineNum">      85 </span>                : /// \ingroup GILIsBasic
<span class="lineNum">      86 </span>                : template &lt;typename Iterator&gt;
<span class="lineNum">      87 </span>                : struct iterator_is_basic : public mpl::false_ {};
<span class="lineNum">      88 </span>                : template &lt;typename T, typename L&gt;  // mutable   interleaved
<span class="lineNum">      89 </span>                : struct iterator_is_basic&lt;      pixel&lt;T,L&gt;*      &gt; : public mpl::true_ {};
<span class="lineNum">      90 </span>                : template &lt;typename T, typename L&gt;  // immutable interleaved
<span class="lineNum">      91 </span>                : struct iterator_is_basic&lt;const pixel&lt;T,L&gt;*      &gt; : public mpl::true_ {};
<span class="lineNum">      92 </span>                : template &lt;typename T, typename Cs&gt;  // mutable   planar
<span class="lineNum">      93 </span>                : struct iterator_is_basic&lt;planar_pixel_iterator&lt;      T*,Cs&gt; &gt; : public mpl::true_ {};
<span class="lineNum">      94 </span>                : template &lt;typename T, typename Cs&gt;    // immutable planar
<span class="lineNum">      95 </span>                : struct iterator_is_basic&lt;planar_pixel_iterator&lt;const T*,Cs&gt; &gt; : public mpl::true_ {};
<span class="lineNum">      96 </span>                : template &lt;typename T, typename L&gt;  // mutable   interleaved step
<span class="lineNum">      97 </span>                : struct iterator_is_basic&lt;memory_based_step_iterator&lt;      pixel&lt;T,L&gt;*&gt; &gt; : public mpl::true_ {};
<span class="lineNum">      98 </span>                : template &lt;typename T, typename L&gt;  // immutable interleaved step
<span class="lineNum">      99 </span>                : struct iterator_is_basic&lt;memory_based_step_iterator&lt;const pixel&lt;T,L&gt;*&gt; &gt; : public mpl::true_ {};
<span class="lineNum">     100 </span>                : template &lt;typename T, typename Cs&gt;  // mutable   planar step
<span class="lineNum">     101 </span>                : struct iterator_is_basic&lt;memory_based_step_iterator&lt;planar_pixel_iterator&lt;      T*,Cs&gt; &gt; &gt; : public mpl::true_ {};
<span class="lineNum">     102 </span>                : template &lt;typename T, typename Cs&gt;    // immutable planar step
<span class="lineNum">     103 </span>                : struct iterator_is_basic&lt;memory_based_step_iterator&lt;planar_pixel_iterator&lt;const T*,Cs&gt; &gt; &gt; : public mpl::true_ {};
<span class="lineNum">     104 </span>                : 
<span class="lineNum">     105 </span>                : 
<span class="lineNum">     106 </span>                : /// \ingroup GILIsBasic
<span class="lineNum">     107 </span>                : /// \brief Determines if a given locator is basic. A basic locator is memory-based and has basic x_iterator and y_iterator
<span class="lineNum">     108 </span>                : template &lt;typename Loc&gt; struct locator_is_basic : public mpl::false_ {};
<span class="lineNum">     109 </span>                : template &lt;typename Iterator&gt; struct locator_is_basic&lt;memory_based_2d_locator&lt;memory_based_step_iterator&lt;Iterator&gt; &gt; &gt; : public iterator_is_basic&lt;Iterator&gt; {};
<span class="lineNum">     110 </span>                : 
<span class="lineNum">     111 </span>                : /// \ingroup GILIsBasic
<span class="lineNum">     112 </span>                : /// \brief Basic views must be over basic locators
<span class="lineNum">     113 </span>                : template &lt;typename View&gt; struct view_is_basic : public mpl::false_ {};
<span class="lineNum">     114 </span>                : template &lt;typename Loc&gt; struct view_is_basic&lt;image_view&lt;Loc&gt; &gt; : public locator_is_basic&lt;Loc&gt; {};
<span class="lineNum">     115 </span>                : 
<span class="lineNum">     116 </span>                : /// \ingroup GILIsBasic
<span class="lineNum">     117 </span>                : /// \brief Basic images must use basic views and std::allocator of char
<span class="lineNum">     118 </span>                : template &lt;typename Img&gt; struct image_is_basic : public mpl::false_ {};
<span class="lineNum">     119 </span>                : template &lt;typename Pixel, bool IsPlanar, typename Alloc&gt; struct image_is_basic&lt;image&lt;Pixel,IsPlanar,Alloc&gt; &gt; : public mpl::true_ {};
<span class="lineNum">     120 </span>                : 
<span class="lineNum">     121 </span>                : 
<span class="lineNum">     122 </span>                : /// \defgroup GILIsStep xxx_is_step
<span class="lineNum">     123 </span>                : /// \ingroup TypeAnalysis
<span class="lineNum">     124 </span>                : /// \brief Determines if the given iterator/locator/view has a step that could be set dynamically
<span class="lineNum">     125 </span>                : 
<span class="lineNum">     126 </span>                : template &lt;typename I&gt; struct iterator_is_step;
<span class="lineNum">     127 </span>                : namespace detail {
<span class="lineNum">     128 </span>                :     template &lt;typename It, bool IsBase, bool EqualsStepType&gt; struct iterator_is_step_impl;
<span class="lineNum">     129 </span>                :     // iterator that has the same type as its dynamic_x_step_type must be a step iterator
<span class="lineNum">     130 </span>                :     template &lt;typename It, bool IsBase&gt; struct iterator_is_step_impl&lt;It,IsBase,true&gt; : public mpl::true_{};
<span class="lineNum">     131 </span>                : 
<span class="lineNum">     132 </span>                :     // base iterator can never be a step iterator
<span class="lineNum">     133 </span>                :     template &lt;typename It&gt; struct iterator_is_step_impl&lt;It,true,false&gt; : public mpl::false_{};
<span class="lineNum">     134 </span>                : 
<span class="lineNum">     135 </span>                :     // for an iterator adaptor, see if its base is step
<span class="lineNum">     136 </span>                :     template &lt;typename It&gt; struct iterator_is_step_impl&lt;It,false,false&gt; 
<span class="lineNum">     137 </span>                :         : public iterator_is_step&lt;typename iterator_adaptor_get_base&lt;It&gt;::type&gt;{};
<span class="lineNum">     138 </span>                : }
<span class="lineNum">     139 </span>                : 
<span class="lineNum">     140 </span>                : /// \ingroup GILIsStep
<span class="lineNum">     141 </span>                : /// \brief Determines if the given iterator has a step that could be set dynamically
<span class="lineNum">     142 </span>                : template &lt;typename I&gt; struct iterator_is_step 
<span class="lineNum">     143 </span>                :     : public detail::iterator_is_step_impl&lt;I, 
<span class="lineNum">     144 </span>                :         !is_iterator_adaptor&lt;I&gt;::type::value,
<span class="lineNum">     145 </span>                :         is_same&lt;I,typename dynamic_x_step_type&lt;I&gt;::type&gt;::value &gt;{};
<span class="lineNum">     146 </span>                : 
<span class="lineNum">     147 </span>                : /// \ingroup GILIsStep
<span class="lineNum">     148 </span>                : /// \brief Determines if the given locator has a horizontal step that could be set dynamically
<span class="lineNum">     149 </span>                : template &lt;typename L&gt; struct locator_is_step_in_x : public iterator_is_step&lt;typename L::x_iterator&gt; {}; 
<span class="lineNum">     150 </span>                : 
<span class="lineNum">     151 </span>                : /// \ingroup GILIsStep
<span class="lineNum">     152 </span>                : /// \brief Determines if the given locator has a vertical step that could be set dynamically
<span class="lineNum">     153 </span>                : template &lt;typename L&gt; struct locator_is_step_in_y : public iterator_is_step&lt;typename L::y_iterator&gt; {}; 
<span class="lineNum">     154 </span>                : 
<span class="lineNum">     155 </span>                : /// \ingroup GILIsStep
<span class="lineNum">     156 </span>                : /// \brief Determines if the given view has a horizontal step that could be set dynamically
<span class="lineNum">     157 </span>                : template &lt;typename V&gt; struct view_is_step_in_x : public locator_is_step_in_x&lt;typename V::xy_locator&gt; {}; 
<span class="lineNum">     158 </span>                : 
<span class="lineNum">     159 </span>                : /// \ingroup GILIsStep
<span class="lineNum">     160 </span>                : /// \brief Determines if the given view has a vertical step that could be set dynamically
<span class="lineNum">     161 </span>                : template &lt;typename V&gt; struct view_is_step_in_y : public locator_is_step_in_y&lt;typename V::xy_locator&gt; {}; 
<span class="lineNum">     162 </span>                : 
<span class="lineNum">     163 </span>                : /// \brief Determines whether the given pixel reference is a proxy class or a native C++ reference
<span class="lineNum">     164 </span>                : /// \ingroup TypeAnalysis
<span class="lineNum">     165 </span>                : template &lt;typename PixelReference&gt;
<span class="lineNum">     166 </span>                : struct pixel_reference_is_proxy
<span class="lineNum">     167 </span>                :     : public mpl::not_&lt;is_same&lt;typename remove_const_and_reference&lt;PixelReference&gt;::type,
<span class="lineNum">     168 </span>                :                                typename remove_const_and_reference&lt;PixelReference&gt;::type::value_type&gt; &gt; {};
<span class="lineNum">     169 </span>                : 
<span class="lineNum">     170 </span>                : /// \brief Given a model of a pixel, determines whether the model represents a pixel reference (as opposed to pixel value)
<span class="lineNum">     171 </span>                : /// \ingroup TypeAnalysis
<span class="lineNum">     172 </span>                : template &lt;typename Pixel&gt;
<span class="lineNum">     173 </span>                : struct pixel_is_reference : public mpl::or_&lt;is_reference&lt;Pixel&gt;, pixel_reference_is_proxy&lt;Pixel&gt; &gt; {};
<span class="lineNum">     174 </span>                : 
<span class="lineNum">     175 </span>                : /// \defgroup GILIsMutable xxx_is_mutable
<span class="lineNum">     176 </span>                : /// \ingroup TypeAnalysis
<span class="lineNum">     177 </span>                : /// \brief Determines if the given pixel reference/iterator/locator/view is mutable (i.e. its pixels can be changed)
<span class="lineNum">     178 </span>                : 
<span class="lineNum">     179 </span>                : /// \ingroup GILIsMutable
<span class="lineNum">     180 </span>                : /// \brief Determines if the given pixel reference is mutable (i.e. its channels can be changed)
<span class="lineNum">     181 </span>                : ///
<span class="lineNum">     182 </span>                : /// Note that built-in C++ references obey the const qualifier but reference proxy classes do not.
<span class="lineNum">     183 </span>                : template &lt;typename R&gt; struct pixel_reference_is_mutable : public mpl::bool_&lt;remove_reference&lt;R&gt;::type::is_mutable&gt; {};
<span class="lineNum">     184 </span>                : template &lt;typename R&gt; struct pixel_reference_is_mutable&lt;const R&amp;&gt;
<span class="lineNum">     185 </span>                :     : public mpl::and_&lt;pixel_reference_is_proxy&lt;R&gt;, pixel_reference_is_mutable&lt;R&gt; &gt; {};
<span class="lineNum">     186 </span>                : 
<span class="lineNum">     187 </span>                : /// \ingroup GILIsMutable
<span class="lineNum">     188 </span>                : /// \brief Determines if the given locator is mutable (i.e. its pixels can be changed)
<span class="lineNum">     189 </span>                : template &lt;typename L&gt; struct locator_is_mutable : public iterator_is_mutable&lt;typename L::x_iterator&gt; {};
<span class="lineNum">     190 </span>                : /// \ingroup GILIsMutable
<span class="lineNum">     191 </span>                : /// \brief Determines if the given view is mutable (i.e. its pixels can be changed)
<span class="lineNum">     192 </span>                : template &lt;typename V&gt; struct view_is_mutable : public iterator_is_mutable&lt;typename V::x_iterator&gt; {};
<span class="lineNum">     193 </span>                : 
<span class="lineNum">     194 </span>                : 
<span class="lineNum">     195 </span>                : //////////////////////////////////////////////////
<span class="lineNum">     196 </span>                : ///
<span class="lineNum">     197 </span>                : ///  TYPE FACTORY METAFUNCTIONS
<span class="lineNum">     198 </span>                : ///  Metafunctions returning GIL types from other GIL types
<span class="lineNum">     199 </span>                : ///
<span class="lineNum">     200 </span>                : //////////////////////////////////////////////////
<span class="lineNum">     201 </span>                : 
<span class="lineNum">     202 </span>                : /// \defgroup TypeFactoryFromElements xxx_type
<span class="lineNum">     203 </span>                : /// \ingroup TypeFactory
<span class="lineNum">     204 </span>                : /// \brief Returns the type of a homogeneous GIL construct given its elements (channel, layout, whether it is planar, step, mutable, etc.)
<span class="lineNum">     205 </span>                : 
<span class="lineNum">     206 </span>                : /// \defgroup TypeFactoryFromPixel xxx_type_from_pixel
<span class="lineNum">     207 </span>                : /// \ingroup TypeFactory
<span class="lineNum">     208 </span>                : /// \brief Returns the type of a GIL construct given its pixel type, whether it is planar, step, mutable, etc.
<span class="lineNum">     209 </span>                : 
<span class="lineNum">     210 </span>                : /// \defgroup TypeFactoryDerived derived_xxx_type
<span class="lineNum">     211 </span>                : /// \ingroup TypeFactory
<span class="lineNum">     212 </span>                : /// \brief Returns the type of a homogeneous GIL construct given a related construct by changing some of its properties
<span class="lineNum">     213 </span>                : 
<span class="lineNum">     214 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     215 </span>                : /// \brief Returns the type of a homogeneous pixel reference given the channel type, layout, whether it operates on planar data and whether it is mutable
<span class="lineNum">     216 </span>                : template &lt;typename T, typename L, bool IsPlanar=false, bool IsMutable=true&gt; struct pixel_reference_type{};
<span class="lineNum">     217 </span>                : template &lt;typename T, typename L&gt; struct pixel_reference_type&lt;T,L,false,true &gt; { typedef pixel&lt;T,L&gt;&amp; type; };
<span class="lineNum">     218 </span>                : template &lt;typename T, typename L&gt; struct pixel_reference_type&lt;T,L,false,false&gt; { typedef const pixel&lt;T,L&gt;&amp; type; };
<span class="lineNum">     219 </span>                : template &lt;typename T, typename L&gt; struct pixel_reference_type&lt;T,L,true,true&gt; { typedef const planar_pixel_reference&lt;typename channel_traits&lt;T&gt;::reference,typename color_space_type&lt;L&gt;::type&gt; type; };       // TODO: Assert M=identity
<span class="lineNum">     220 </span>                : template &lt;typename T, typename L&gt; struct pixel_reference_type&lt;T,L,true,false&gt; { typedef const planar_pixel_reference&lt;typename channel_traits&lt;T&gt;::const_reference,typename color_space_type&lt;L&gt;::type&gt; type; };// TODO: Assert M=identity
<span class="lineNum">     221 </span>                : 
<span class="lineNum">     222 </span>                : /// \ingroup TypeFactoryFromPixel
<span class="lineNum">     223 </span>                : /// \brief Returns the type of a pixel iterator given the pixel type, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
<span class="lineNum">     224 </span>                : template &lt;typename Pixel, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true&gt; struct iterator_type_from_pixel{};
<span class="lineNum">     225 </span>                : template &lt;typename Pixel&gt; struct iterator_type_from_pixel&lt;Pixel,false,false,true &gt; { typedef Pixel* type; };
<span class="lineNum">     226 </span>                : template &lt;typename Pixel&gt; struct iterator_type_from_pixel&lt;Pixel,false,false,false&gt; { typedef const Pixel* type; };
<span class="lineNum">     227 </span>                : template &lt;typename Pixel&gt; struct iterator_type_from_pixel&lt;Pixel,true,false,true&gt; { 
<span class="lineNum">     228 </span>                :     typedef planar_pixel_iterator&lt;typename channel_traits&lt;typename channel_type&lt;Pixel&gt;::type&gt;::pointer,typename color_space_type&lt;Pixel&gt;::type&gt; type; 
<span class="lineNum">     229 </span>                : };
<span class="lineNum">     230 </span>                : template &lt;typename Pixel&gt; struct iterator_type_from_pixel&lt;Pixel,true,false,false&gt; { 
<span class="lineNum">     231 </span>                :     typedef planar_pixel_iterator&lt;typename channel_traits&lt;typename channel_type&lt;Pixel&gt;::type&gt;::const_pointer,typename color_space_type&lt;Pixel&gt;::type&gt; type; 
<span class="lineNum">     232 </span>                : };
<span class="lineNum">     233 </span>                : template &lt;typename Pixel, bool IsPlanar, bool IsMutable&gt; struct iterator_type_from_pixel&lt;Pixel,IsPlanar,true,IsMutable&gt; { 
<span class="lineNum">     234 </span>                :     typedef memory_based_step_iterator&lt;typename iterator_type_from_pixel&lt;Pixel,IsPlanar,false,IsMutable&gt;::type&gt; type; 
<span class="lineNum">     235 </span>                : };
<span class="lineNum">     236 </span>                : 
<span class="lineNum">     237 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     238 </span>                : /// \brief Returns the type of a homogeneous iterator given the channel type, layout, whether it operates on planar data, whether it is a step iterator, and whether it is mutable
<span class="lineNum">     239 </span>                : template &lt;typename T, typename L, bool IsPlanar=false, bool IsStep=false, bool IsMutable=true&gt; struct iterator_type{};
<span class="lineNum">     240 </span>                : template &lt;typename T, typename L&gt; struct iterator_type&lt;T,L,false,false,true &gt; { typedef pixel&lt;T,L&gt;* type; };
<span class="lineNum">     241 </span>                : template &lt;typename T, typename L&gt; struct iterator_type&lt;T,L,false,false,false&gt; { typedef const pixel&lt;T,L&gt;* type; };
<span class="lineNum">     242 </span>                : template &lt;typename T, typename L&gt; struct iterator_type&lt;T,L,true,false,true&gt; { typedef planar_pixel_iterator&lt;T*,typename L::color_space_t&gt; type; };               // TODO: Assert M=identity
<span class="lineNum">     243 </span>                : template &lt;typename T, typename L&gt; struct iterator_type&lt;T,L,true,false,false&gt; { typedef planar_pixel_iterator&lt;const T*,typename L::color_space_t&gt; type; };        // TODO: Assert M=identity
<span class="lineNum">     244 </span>                : template &lt;typename T, typename L, bool IsPlanar, bool IsMutable&gt; struct iterator_type&lt;T,L,IsPlanar,true,IsMutable&gt; { 
<span class="lineNum">     245 </span>                :     typedef memory_based_step_iterator&lt;typename iterator_type&lt;T,L,IsPlanar,false,IsMutable&gt;::type&gt; type; 
<span class="lineNum">     246 </span>                : };
<span class="lineNum">     247 </span>                : 
<span class="lineNum">     248 </span>                : /// \brief Given a pixel iterator defining access to pixels along a row, returns the types of the corresponding built-in step_iterator, xy_locator, image_view
<span class="lineNum">     249 </span>                : /// \ingroup TypeFactory
<span class="lineNum">     250 </span>                : template &lt;typename XIterator&gt; 
<span class="lineNum">     251 </span>                : struct type_from_x_iterator {
<span class="lineNum">     252 </span>                :     typedef memory_based_step_iterator&lt;XIterator&gt;    step_iterator_t;
<span class="lineNum">     253 </span>                :     typedef memory_based_2d_locator&lt;step_iterator_t&gt; xy_locator_t;
<span class="lineNum">     254 </span>                :     typedef image_view&lt;xy_locator_t&gt;                     view_t;
<span class="lineNum">     255 </span>                : };
<span class="lineNum">     256 </span>                : 
<span class="lineNum">     257 </span>                : namespace detail {
<span class="lineNum">     258 </span>                :     template &lt;typename BitField, typename FirstBit, typename NumBits&gt;
<span class="lineNum">     259 </span>                :     struct packed_channel_reference_type {
<span class="lineNum">     260 </span>                :         typedef const packed_channel_reference&lt;BitField,FirstBit::value,NumBits::value,true&gt; type;
<span class="lineNum">     261 </span>                :     };
<span class="lineNum">     262 </span>                : 
<span class="lineNum">     263 </span>                :     template &lt;typename BitField, typename ChannelBitSizesVector&gt;
<span class="lineNum">     264 </span>                :     class packed_channel_references_vector_type {
<span class="lineNum">     265 </span>                :         // If ChannelBitSizesVector is mpl::vector&lt;int,7,7,2&gt;
<span class="lineNum">     266 </span>                :         // Then first_bits_vector will be mpl::vector&lt;int,0,7,14,16&gt;
<span class="lineNum">     267 </span>                :         typedef typename mpl::accumulate&lt;ChannelBitSizesVector, mpl::vector1&lt;mpl::int_&lt;0&gt; &gt;, 
<span class="lineNum">     268 </span>                :             mpl::push_back&lt;mpl::_1, mpl::plus&lt;mpl::back&lt;mpl::_1&gt;, mpl::_2&gt; &gt; &gt;::type first_bits_vector;
<span class="lineNum">     269 </span>                :     public:
<span class="lineNum">     270 </span>                :         typedef typename mpl::transform&lt;typename mpl::pop_back&lt;first_bits_vector&gt;::type, ChannelBitSizesVector,
<span class="lineNum">     271 </span>                :                packed_channel_reference_type&lt;BitField, mpl::_1,mpl::_2&gt; &gt;::type type;
<span class="lineNum">     272 </span>                :     };
<span class="lineNum">     273 </span>                : 
<span class="lineNum">     274 </span>                : }
<span class="lineNum">     275 </span>                : 
<span class="lineNum">     276 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     277 </span>                : /// \brief Returns the type of a packed pixel given its bitfield type, the bit size of its channels and its layout.
<span class="lineNum">     278 </span>                : ///
<span class="lineNum">     279 </span>                : /// A packed pixel has channels that cover bit ranges but itself is byte aligned. RGB565 pixel is an example.
<span class="lineNum">     280 </span>                : ///
<span class="lineNum">     281 </span>                : /// The size of ChannelBitSizeVector must equal the number of channels in the given layout
<span class="lineNum">     282 </span>                : /// The sum of bit sizes for all channels must be less than or equal to the number of bits in BitField (and cannot exceed 64).
<span class="lineNum">     283 </span>                : ///  If it is less than the number of bits in BitField, the last bits will be unused.
<span class="lineNum">     284 </span>                : template &lt;typename BitField, typename ChannelBitSizeVector, typename Layout&gt;
<span class="lineNum">     285 </span>                : struct packed_pixel_type {
<span class="lineNum">     286 </span>                :     typedef packed_pixel&lt;BitField, typename detail::packed_channel_references_vector_type&lt;BitField,ChannelBitSizeVector&gt;::type, Layout&gt; type;
<span class="lineNum">     287 </span>                : };
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                : /// \defgroup TypeFactoryPacked packed_image_type,bit_aligned_image_type
<span class="lineNum">     290 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     291 </span>                : /// \brief Returns the type of an image whose channels are not byte-aligned. 
<span class="lineNum">     292 </span>                : /// 
<span class="lineNum">     293 </span>                : /// A packed image is an image whose pixels are byte aligned, such as &quot;rgb565&quot;. &lt;br&gt;
<span class="lineNum">     294 </span>                : /// A bit-aligned image is an image whose pixels are not byte aligned, such as &quot;rgb222&quot;. &lt;br&gt;
<span class="lineNum">     295 </span>                : /// 
<span class="lineNum">     296 </span>                : /// The sum of the bit sizes of all channels cannot exceed 64.
<span class="lineNum">     297 </span>                : 
<span class="lineNum">     298 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     299 </span>                : /// \brief Returns the type of an interleaved packed image: an image whose channels may not be byte-aligned, but whose pixels are byte aligned.
<span class="lineNum">     300 </span>                : template &lt;typename BitField, typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     301 </span>                : struct packed_image_type {
<span class="lineNum">     302 </span>                :     typedef image&lt;typename packed_pixel_type&lt;BitField,ChannelBitSizeVector,Layout&gt;::type,false,Alloc&gt; type;
<span class="lineNum">     303 </span>                : };
<span class="lineNum">     304 </span>                : 
<span class="lineNum">     305 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     306 </span>                : /// \brief Returns the type of a single-channel image given its bitfield type, the bit size of its channel and its layout
<span class="lineNum">     307 </span>                : template &lt;typename BitField, unsigned Size1, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     308 </span>                : struct packed_image1_type : public packed_image_type&lt;BitField, mpl::vector1_c&lt;unsigned, Size1&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     309 </span>                : 
<span class="lineNum">     310 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     311 </span>                : /// \brief Returns the type of a two channel image given its bitfield type, the bit size of its channels and its layout
<span class="lineNum">     312 </span>                : template &lt;typename BitField, unsigned Size1, unsigned Size2, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     313 </span>                : struct packed_image2_type : public packed_image_type&lt;BitField, mpl::vector2_c&lt;unsigned, Size1, Size2&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     314 </span>                : 
<span class="lineNum">     315 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     316 </span>                : /// \brief Returns the type of a three channel image given its bitfield type, the bit size of its channels and its layout
<span class="lineNum">     317 </span>                : template &lt;typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     318 </span>                : struct packed_image3_type : public packed_image_type&lt;BitField, mpl::vector3_c&lt;unsigned, Size1, Size2, Size3&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     319 </span>                : 
<span class="lineNum">     320 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     321 </span>                : /// \brief Returns the type of a four channel image given its bitfield type, the bit size of its channels and its layout
<span class="lineNum">     322 </span>                : template &lt;typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     323 </span>                : struct packed_image4_type : public packed_image_type&lt;BitField, mpl::vector4_c&lt;unsigned, Size1, Size2, Size3, Size4&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     324 </span>                : 
<span class="lineNum">     325 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     326 </span>                : /// \brief Returns the type of a five channel image given its bitfield type, the bit size of its channels and its layout
<span class="lineNum">     327 </span>                : template &lt;typename BitField, unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     328 </span>                : struct packed_image5_type : public packed_image_type&lt;BitField, mpl::vector5_c&lt;unsigned, Size1, Size2, Size3, Size4, Size5&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     329 </span>                : 
<span class="lineNum">     330 </span>                : 
<span class="lineNum">     331 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     332 </span>                : /// \brief Returns the type of a packed image whose pixels may not be byte aligned. For example, an &quot;rgb222&quot; image is bit-aligned because its pixel spans six bits.
<span class="lineNum">     333 </span>                : ///
<span class="lineNum">     334 </span>                : /// Note that the alignment parameter in the constructor of bit-aligned images is in bit units. For example, if you want to construct a bit-aligned
<span class="lineNum">     335 </span>                : /// image whose rows are byte-aligned, use 8 as the alignment parameter, not 1.
<span class="lineNum">     336 </span>                : 
<span class="lineNum">     337 </span>                : template &lt;typename ChannelBitSizeVector, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     338 </span>                : struct bit_aligned_image_type {
<span class="lineNum">     339 </span>                : private:
<span class="lineNum">     340 </span>                :     BOOST_STATIC_CONSTANT(int, bit_size = (mpl::accumulate&lt;ChannelBitSizeVector, mpl::int_&lt;0&gt;, mpl::plus&lt;mpl::_1, mpl::_2&gt; &gt;::type::value));
<span class="lineNum">     341 </span>                :     typedef typename detail::min_fast_uint&lt;bit_size+7&gt;::type                        bitfield_t;  
<span class="lineNum">     342 </span>                :     typedef const bit_aligned_pixel_reference&lt;bitfield_t, ChannelBitSizeVector, Layout, true&gt; bit_alignedref_t;
<span class="lineNum">     343 </span>                : public:
<span class="lineNum">     344 </span>                :     typedef image&lt;bit_alignedref_t,false,Alloc&gt; type;
<span class="lineNum">     345 </span>                : };
<span class="lineNum">     346 </span>                : 
<span class="lineNum">     347 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     348 </span>                : /// \brief Returns the type of a single-channel bit-aligned image given the bit size of its channel and its layout
<span class="lineNum">     349 </span>                : template &lt;unsigned Size1, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     350 </span>                : struct bit_aligned_image1_type : public bit_aligned_image_type&lt;mpl::vector1_c&lt;unsigned, Size1&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     351 </span>                : 
<span class="lineNum">     352 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     353 </span>                : /// \brief Returns the type of a two channel bit-aligned image given the bit size of its channels and its layout
<span class="lineNum">     354 </span>                : template &lt;unsigned Size1, unsigned Size2, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     355 </span>                : struct bit_aligned_image2_type : public bit_aligned_image_type&lt;mpl::vector2_c&lt;unsigned, Size1, Size2&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     356 </span>                : 
<span class="lineNum">     357 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     358 </span>                : /// \brief Returns the type of a three channel bit-aligned image given the bit size of its channels and its layout
<span class="lineNum">     359 </span>                : template &lt;unsigned Size1, unsigned Size2, unsigned Size3, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     360 </span>                : struct bit_aligned_image3_type : public bit_aligned_image_type&lt;mpl::vector3_c&lt;unsigned, Size1, Size2, Size3&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     361 </span>                : 
<span class="lineNum">     362 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     363 </span>                : /// \brief Returns the type of a four channel bit-aligned image given the bit size of its channels and its layout
<span class="lineNum">     364 </span>                : template &lt;unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     365 </span>                : struct bit_aligned_image4_type : public bit_aligned_image_type&lt;mpl::vector4_c&lt;unsigned, Size1, Size2, Size3, Size4&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     366 </span>                : 
<span class="lineNum">     367 </span>                : /// \ingroup TypeFactoryPacked
<span class="lineNum">     368 </span>                : /// \brief Returns the type of a five channel bit-aligned image given the bit size of its channels and its layout
<span class="lineNum">     369 </span>                : template &lt;unsigned Size1, unsigned Size2, unsigned Size3, unsigned Size4, unsigned Size5, typename Layout, typename Alloc=std::allocator&lt;unsigned char&gt; &gt;
<span class="lineNum">     370 </span>                : struct bit_aligned_image5_type : public bit_aligned_image_type&lt;mpl::vector5_c&lt;unsigned, Size1, Size2, Size3, Size4, Size5&gt;, Layout, Alloc&gt; {};
<span class="lineNum">     371 </span>                : 
<span class="lineNum">     372 </span>                : 
<span class="lineNum">     373 </span>                : 
<span class="lineNum">     374 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     375 </span>                : /// \brief Returns the type of a homogeneous pixel given the channel type and layout
<span class="lineNum">     376 </span>                : template &lt;typename Channel, typename Layout&gt; 
<span class="lineNum">     377 </span>                : struct pixel_value_type {
<span class="lineNum">     378 </span>                :     typedef pixel&lt;Channel,Layout&gt; type;     // by default use gil::pixel. Specializations are provided for 
<span class="lineNum">     379 </span>                : };
<span class="lineNum">     380 </span>                : 
<span class="lineNum">     381 </span>                : // Specializations for packed channels
<span class="lineNum">     382 </span>                : template &lt;typename BitField, int NumBits, bool IsMutable, typename Layout&gt; 
<span class="lineNum">     383 </span>                : struct pixel_value_type&lt;      packed_dynamic_channel_reference&lt;BitField,NumBits,IsMutable&gt;,Layout&gt; :
<span class="lineNum">     384 </span>                :     public packed_pixel_type&lt;BitField, mpl::vector1_c&lt;unsigned,NumBits&gt;, Layout&gt; {};
<span class="lineNum">     385 </span>                : template &lt;typename BitField, int NumBits, bool IsMutable, typename Layout&gt; 
<span class="lineNum">     386 </span>                : struct pixel_value_type&lt;const packed_dynamic_channel_reference&lt;BitField,NumBits,IsMutable&gt;,Layout&gt; :
<span class="lineNum">     387 </span>                :     public packed_pixel_type&lt;BitField, mpl::vector1_c&lt;unsigned,NumBits&gt;, Layout&gt; {};
<span class="lineNum">     388 </span>                : 
<span class="lineNum">     389 </span>                : template &lt;typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout&gt; 
<span class="lineNum">     390 </span>                : struct pixel_value_type&lt;      packed_channel_reference&lt;BitField,FirstBit,NumBits,IsMutable&gt;,Layout&gt; :
<span class="lineNum">     391 </span>                :     public packed_pixel_type&lt;BitField, mpl::vector1_c&lt;unsigned,NumBits&gt;, Layout&gt; {};
<span class="lineNum">     392 </span>                : template &lt;typename BitField, int FirstBit, int NumBits, bool IsMutable, typename Layout&gt; 
<span class="lineNum">     393 </span>                : struct pixel_value_type&lt;const packed_channel_reference&lt;BitField,FirstBit,NumBits,IsMutable&gt;,Layout&gt; :
<span class="lineNum">     394 </span>                :     public packed_pixel_type&lt;BitField, mpl::vector1_c&lt;unsigned,NumBits&gt;, Layout&gt; {};
<span class="lineNum">     395 </span>                : 
<span class="lineNum">     396 </span>                : template &lt;int NumBits, typename Layout&gt; 
<span class="lineNum">     397 </span>                : struct pixel_value_type&lt;packed_channel_value&lt;NumBits&gt;,Layout&gt; :
<span class="lineNum">     398 </span>                :     public packed_pixel_type&lt;typename detail::min_fast_uint&lt;NumBits&gt;::type, mpl::vector1_c&lt;unsigned,NumBits&gt;, Layout&gt; {};
<span class="lineNum">     399 </span>                : 
<span class="lineNum">     400 </span>                : 
<span class="lineNum">     401 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     402 </span>                : /// \brief Returns the type of a homogeneous locator given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
<span class="lineNum">     403 </span>                : template &lt;typename T, typename L, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true&gt; 
<span class="lineNum">     404 </span>                : struct locator_type {
<span class="lineNum">     405 </span>                :     typedef typename type_from_x_iterator&lt;typename iterator_type&lt;T,L,IsPlanar,IsStepX,IsMutable&gt;::type&gt;::xy_locator_type type;
<span class="lineNum">     406 </span>                : };
<span class="lineNum">     407 </span>                : 
<span class="lineNum">     408 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     409 </span>                : /// \brief Returns the type of a homogeneous view given the channel type, layout, whether it operates on planar data and whether it has a step horizontally
<span class="lineNum">     410 </span>                : template &lt;typename T, typename L, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true&gt; 
<span class="lineNum">     411 </span>                : struct view_type {
<span class="lineNum">     412 </span>                :     typedef typename type_from_x_iterator&lt;typename iterator_type&lt;T,L,IsPlanar,IsStepX,IsMutable&gt;::type&gt;::view_t type;
<span class="lineNum">     413 </span>                : };
<span class="lineNum">     414 </span>                : 
<span class="lineNum">     415 </span>                : /// \ingroup TypeFactoryFromElements
<span class="lineNum">     416 </span>                : /// \brief Returns the type of a homogeneous image given the channel type, layout, and whether it operates on planar data
<span class="lineNum">     417 </span>                : template &lt;typename T, typename L, bool IsPlanar=false, typename Alloc=std::allocator&lt;unsigned char&gt; &gt; 
<span class="lineNum">     418 </span>                : struct image_type {
<span class="lineNum">     419 </span>                :     typedef image&lt;pixel&lt;T,L&gt;, IsPlanar, Alloc&gt; type;
<span class="lineNum">     420 </span>                : };
<span class="lineNum">     421 </span>                : 
<span class="lineNum">     422 </span>                : /// \ingroup TypeFactoryFromPixel
<span class="lineNum">     423 </span>                : /// \brief Returns the type of a view the pixel type, whether it operates on planar data and whether it has a step horizontally
<span class="lineNum">     424 </span>                : template &lt;typename Pixel, bool IsPlanar=false, bool IsStepX=false, bool IsMutable=true&gt; 
<span class="lineNum">     425 </span>                : struct view_type_from_pixel {
<span class="lineNum">     426 </span>                :     typedef typename type_from_x_iterator&lt;typename iterator_type_from_pixel&lt;Pixel,IsPlanar,IsStepX,IsMutable&gt;::type&gt;::view_t type;
<span class="lineNum">     427 </span>                : };
<span class="lineNum">     428 </span>                : 
<span class="lineNum">     429 </span>                : 
<span class="lineNum">     430 </span>                : /// \brief Constructs a pixel reference type from a source pixel reference type by changing some of the properties.
<span class="lineNum">     431 </span>                : /// \ingroup TypeFactoryDerived
<span class="lineNum">     432 </span>                : ///  Use use_default for the properties of the source view that you want to keep
<span class="lineNum">     433 </span>                : template &lt;typename Ref, typename T=use_default, typename L=use_default, typename IsPlanar=use_default, typename IsMutable=use_default&gt;
<span class="lineNum">     434 </span>                : class derived_pixel_reference_type {
<span class="lineNum">     435 </span>                :     typedef typename remove_reference&lt;Ref&gt;::type pixel_t;
<span class="lineNum">     436 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;T, use_default&gt;, typename channel_type&lt;pixel_t&gt;::type,     T &gt;::type channel_t;
<span class="lineNum">     437 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;L, use_default&gt;, 
<span class="lineNum">     438 </span>                :         layout&lt;typename color_space_type&lt;pixel_t&gt;::type, typename channel_mapping_type&lt;pixel_t&gt;::type&gt;, L&gt;::type           layout_t;
<span class="lineNum">     439 </span>                :     static const bool mut   =mpl::if_&lt;is_same&lt;IsMutable,use_default&gt;, pixel_reference_is_mutable&lt;Ref&gt;, IsMutable&gt;::type::value;
<span class="lineNum">     440 </span>                :     static const bool planar=mpl::if_&lt;is_same&lt;IsPlanar,use_default&gt;,  is_planar&lt;pixel_t&gt;,  IsPlanar&gt;::type::value;
<span class="lineNum">     441 </span>                : public:
<span class="lineNum">     442 </span>                :     typedef typename pixel_reference_type&lt;channel_t, layout_t, planar, mut&gt;::type type;
<span class="lineNum">     443 </span>                : };
<span class="lineNum">     444 </span>                : 
<span class="lineNum">     445 </span>                : /// \brief Constructs a pixel iterator type from a source pixel iterator type by changing some of the properties.
<span class="lineNum">     446 </span>                : /// \ingroup TypeFactoryDerived
<span class="lineNum">     447 </span>                : ///  Use use_default for the properties of the source view that you want to keep
<span class="lineNum">     448 </span>                : template &lt;typename Iterator, typename T=use_default, typename L=use_default, typename IsPlanar=use_default, typename IsStep=use_default, typename IsMutable=use_default&gt;
<span class="lineNum">     449 </span>                : class derived_iterator_type {
<span class="lineNum">     450 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;T ,use_default&gt;, typename channel_type&lt;Iterator&gt;::type,     T &gt;::type channel_t;
<span class="lineNum">     451 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;L,use_default&gt;, 
<span class="lineNum">     452 </span>                :         layout&lt;typename color_space_type&lt;Iterator&gt;::type, typename channel_mapping_type&lt;Iterator&gt;::type&gt;, L&gt;::type layout_t;
<span class="lineNum">     453 </span>                : 
<span class="lineNum">     454 </span>                :     static const bool mut   =mpl::if_&lt;is_same&lt;IsMutable,use_default&gt;, iterator_is_mutable&lt;Iterator&gt;, IsMutable&gt;::type::value;
<span class="lineNum">     455 </span>                :     static const bool planar=mpl::if_&lt;is_same&lt;IsPlanar,use_default&gt;,         is_planar&lt;Iterator&gt;,  IsPlanar&gt;::type::value;
<span class="lineNum">     456 </span>                :     static const bool step  =mpl::if_&lt;is_same&lt;IsStep  ,use_default&gt;,  iterator_is_step&lt;Iterator&gt;,    IsStep&gt;::type::value;
<span class="lineNum">     457 </span>                : public:
<span class="lineNum">     458 </span>                :     typedef typename iterator_type&lt;channel_t, layout_t, planar, step, mut&gt;::type type;
<span class="lineNum">     459 </span>                : };
<span class="lineNum">     460 </span>                : 
<span class="lineNum">     461 </span>                : /// \brief Constructs an image view type from a source view type by changing some of the properties.
<span class="lineNum">     462 </span>                : /// \ingroup TypeFactoryDerived
<span class="lineNum">     463 </span>                : ///  Use use_default for the properties of the source view that you want to keep
<span class="lineNum">     464 </span>                : template &lt;typename View, typename T=use_default, typename L=use_default, typename IsPlanar=use_default, typename StepX=use_default, typename IsMutable=use_default&gt;
<span class="lineNum">     465 </span>                : class derived_view_type {
<span class="lineNum">     466 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;T ,use_default&gt;, typename channel_type&lt;View&gt;::type, T&gt;::type channel_t;
<span class="lineNum">     467 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;L,use_default&gt;, 
<span class="lineNum">     468 </span>                :         layout&lt;typename color_space_type&lt;View&gt;::type, typename channel_mapping_type&lt;View&gt;::type&gt;, L&gt;::type layout_t;
<span class="lineNum">     469 </span>                :     static const bool mut   =mpl::if_&lt;is_same&lt;IsMutable,use_default&gt;, view_is_mutable&lt;View&gt;, IsMutable&gt;::type::value;
<span class="lineNum">     470 </span>                :     static const bool planar=mpl::if_&lt;is_same&lt;IsPlanar,use_default&gt;,  is_planar&lt;View&gt;,  IsPlanar&gt;::type::value;
<span class="lineNum">     471 </span>                :     static const bool step  =mpl::if_&lt;is_same&lt;StepX ,use_default&gt;,  view_is_step_in_x&lt;View&gt;,StepX&gt;::type::value;
<span class="lineNum">     472 </span>                : public:
<span class="lineNum">     473 </span>                :     typedef typename view_type&lt;channel_t, layout_t, planar, step, mut&gt;::type type;
<span class="lineNum">     474 </span>                : };
<span class="lineNum">     475 </span>                : 
<span class="lineNum">     476 </span>                : /// \brief Constructs a homogeneous image type from a source image type by changing some of the properties.
<span class="lineNum">     477 </span>                : /// \ingroup TypeFactoryDerived
<span class="lineNum">     478 </span>                : ///  Use use_default for the properties of the source image that you want to keep
<span class="lineNum">     479 </span>                : template &lt;typename Image, typename T=use_default, typename L=use_default, typename IsPlanar=use_default&gt;
<span class="lineNum">     480 </span>                : class derived_image_type {
<span class="lineNum">     481 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;T ,use_default&gt;, typename channel_type&lt;Image&gt;::type,     T &gt;::type channel_t;
<span class="lineNum">     482 </span>                :     typedef typename  mpl::if_&lt;is_same&lt;L,use_default&gt;, 
<span class="lineNum">     483 </span>                :         layout&lt;typename color_space_type&lt;Image&gt;::type, typename channel_mapping_type&lt;Image&gt;::type&gt;, L&gt;::type layout_t;
<span class="lineNum">     484 </span>                :     static const bool planar=mpl::if_&lt;is_same&lt;IsPlanar,use_default&gt;,  is_planar&lt;Image&gt;,  IsPlanar&gt;::type::value;
<span class="lineNum">     485 </span>                : public:
<span class="lineNum">     486 </span>                :     typedef typename image_type&lt;channel_t, layout_t, planar&gt;::type type;
<span class="lineNum">     487 </span>                : };
<span class="lineNum">     488 </span>                : 
<span class="lineNum">     489 </span>                : 
<span class="lineNum">     490 </span>                : 
<span class="lineNum">     491 </span>                : 
<span class="lineNum">     492 </span>                : } }  // namespace boost::gil
<span class="lineNum">     493 </span>                : 
<span class="lineNum">     494 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
